# -*- coding: utf-8 -*-
"""
------------------------------------------------------------------------------
    File Name:  HtmlDownLoader
    Author   :  wanwei1029
    Date     :  2018/5/17
    Desc     :
------------------------------------------------------------------------------
"""
import requests


class HtmlDownLoader(object):

    def download(self, url):
        if url is None:
            return
        user_agent = 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)'
        heads = {'User-Agent':user_agent}
        r = requests.get(url, headers=heads)
        if r.status_code == 200:
            r.encoding = 'utf-8'
            return r.text
        return None
